package com.huatai.bi.utils;

import org.apache.commons.lang3.RandomStringUtils;

/**
 * @BelongsProject: itc-airport-cloud
 * @BelongsPackage: com.huatai.bi.utils
 * @Author: hecaiy
 * @CreateTime: 2024-06-25  09:51
 * @Description: TODO
 * @Version: 1.0
 */
public class CodeGenerateUtils {

	/**
	 * 根据名称统一生成编码
	 *
	 * @param prefix 前缀
	 * @return
	 */
	public static String generate(String prefix) {
		if ("app".equals(prefix)) {
			return prefix + "-" + RandomStringUtils.randomAlphanumeric(10).toLowerCase();
		}
		return prefix + "_" + RandomStringUtils.randomAlphanumeric(10);
	}
}
